package com.agent.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.agent.mapper.HatProvinceMapper;
import com.agent.pojo.HatProvince;
import com.agent.pojo.HatProvinceExample;
import com.agent.service.HatProvinceService;
@Service
public class HatProvinceServiceImpl implements HatProvinceService{
	@Resource
	private HatProvinceMapper hatProvinceMapper;
	@Override
	public List<HatProvince> findAll() {
		// TODO Auto-generated method stub
		return hatProvinceMapper.selectByExample(null);
	}
	@Override
	public HatProvince findOne(int id) {
		// TODO Auto-generated method stub
		return hatProvinceMapper.selectByPrimaryKey(id);
	}
	@Override
	public List<HatProvince> findByProvinceId(String provinceId) {
		// TODO Auto-generated method stub
		HatProvinceExample example = new HatProvinceExample();
		if(provinceId!=null&&provinceId.length()>0) {
			example.createCriteria().andProvinceidEqualTo(provinceId);
		}
		return hatProvinceMapper.selectByExample(example);
	}

}
